<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title><?php echo $view->title;?></title>
		
		<!-- Define CSS stylesheets -->
		<link rel="stylesheet" href="_jslib/jquery/themes/base/jquery.ui.all.css">
		<link rel="stylesheet" type="text/css" href="_styles/css/main.css">
		<link rel="stylesheet" type="text/css" href="_styles/css/forms.css">
		
		<!-- Define Javascript Libraries -->
		<script type="text/javascript" src="_jslib/jquery/jquery-1.10.2.js"></script>
		<script type="text/javascript" src="_jslib/jquery/ui/jquery-ui.js"></script>	
		<script type="text/javascript" src="_jslib/jquery/ui/jquery.ui.core.js"></script>
		<script type="text/javascript" src="_jslib/jquery/ui/jquery.ui.widget.js"></script>
		<script type="text/javascript" src="_jslib/jquery/ui/jquery.ui.mouse.js"></script>
		<script type="text/javascript" src="_jslib/jquery/ui/jquery.ui.button.js"></script>
		<script type="text/javascript" src="_jslib/jquery/ui/jquery.ui.draggable.js"></script>
		<script type="text/javascript" src="_jslib/jquery/ui/jquery.ui.position.js"></script>
		<script type="text/javascript" src="_jslib/jquery/ui/jquery.ui.dialog.js"></script>
		<script type="text/javascript" src="_jslib/jquery/watermark/jquery.watermark.js"></script>
		<script type="text/javascript" src="_jslib/main.js"></script>
		<script>
			$(document).ready(function() {
    			$("#keyword").watermark("Enter your keyword");
			    $("#tabs").tabs();
			    $("#menu").menu({position: {at: "left bottom"}});
			    setInterval("formDateTimeStr()", 1000);

			    $("#pagelinks").change(function() {
			    	var url 		 = $("#page_url").val();
					var pagenum      = $('#pagelinks :selected').val();
    				var redirect_url = "<?=APP_ROOT?>/"+url+"&page="+pagenum;
   			 		window.location.replace(redirect_url);
				});

				$("#reset").click(function() {
					resetFormFields("searchForm");
					var url = location.href;
					window.location.replace(url);
				});
			});
		</script>
	</head>

	<body>
		<?//dump($_SESSION);?>
		<!-- template html here -->
		<div id="content">
			<div id="main_header">
				<h3>Gemba360 GP Clinic</h3>
				<p class="main_head">
					<span class="main_name">
						Welcome 
						<?php
							if($_SESSION['user']['user_type_id'] != CONST_SUPER_ADMIN_TYPE){
								echo ($_SESSION['user']['is_practicioner'] == 1) ? $_SESSION['user']['practicioner_name'] : $_SESSION['user']['nonpracticioner_name'];
							}else{
								echo $_SESSION['user']['username'];
							}
						?>
						<a href="<?=APP_ROOT?>/logout">(Logout)</a>
					</span> 
					<span class="main_time"></span>
				</p>
			</div>

			<?include("pages/header_menu.php");?>
			
			<div id="main_content">
				<?php include($view->page); ?>
			</div>
			<div id="footer">
				Copyright &copy; 2014 Gemba360.
			</div>
		</div>

		<!-- Dialog box pop-ups -->
		<div id="deleteDiv" title="Are you sure you want to delete this?" style="display:none;">
		    <iframe id="delete" width="350" height="80"></iframe>
		</div>
		
	</body>
</html>

